<script type="text/javascript">
	function check_pl(starts){
		$("#starvalue").val(starts);
	}
	function checklen(){
		var txt_comment = $("#comment").val();
		if(len(txt_comment)>200){
			$("#comment").val(txt_comment.substr(0,200)) ;
		}
	}
	function len(s) {
		var l = 0;
		var a = s.split("");
		for (var i=0;i<a.length;i++) {
		if (a[i].charCodeAt(0)<299) {
			l++;
		} else {
			l+=2;
		}
		}
			return l;
	}
	
</script>
<style>
.user_rate {font-size:14px; position:relative; padding:10px 0;margin-left:-90px;}
.user_rate p {margin:0; padding:0; display:inline; height:40px; overflow:hidden; position:absolute; top:0; left:100px; margin-left:140px;}
.user_rate p span.s {font-size:36px; line-height:36px; float:left; font-weight:bold; color:#DD5400;}
.user_rate p span.g {font-size:22px; display:block; float:left; color:#DD5400;}
.big_rate_bak {width:140px; height:28px; text-align:left; position:absolute; top:3px; left:85px; display:inline-block; background:url(/pic/b_star.gif) left bottom repeat-x;}
.big_rate_bak b {display:inline-block; width:24px; height:28px; position:relative; z-index:1000; cursor:pointer; overflow:hidden;}
.big_rate_up {width:140px; height:28px; position:absolute; top:0; left:0; background:url(/pic/b_star.gif) left top;}
.remark{position:relative;left:220px; top:-10px;}
</style>
<div class="evaluatebj">
    <div class="evaluate">
    	<div class="evaluatewz">
        	<h1>您的位置：<a href="#">我的帐户</a><span>&gt;</span><a href="#">我的国际运单</a><span>&gt;</span>悠奇服务评价</h1>
        </div>
        <div class="buzhou">
        	服务步骤
        </div>

        <div class="ping">
        <form method="POST" name="evaluate"  action="/member/evaluate/">
        	<div class="pingleft">
            	<table>
                	<tr>
                    	<td class="pl">服务评级：</td>
                        <td>
                        	<ul>
                            	<li><label><input type="radio" name="service"  value="1"/><i class="hao"></i><span>好评</span></label></li>
                            	<li><label><input type="radio" name="service" value="2"/><i class="zhong"></i><span>中评</span></label></li>
                            	<li><label><input type="radio" name="service" value="3"/><i class="cha"></i><span>差评</span></label></li>
                            </ul>
                        </td>
                    </tr>
                	<tr>
                    	<td class="pl">评价内容：</td>
                        <td>
                        	<div class="pingnr">
                            	<p>请对我们的服务给予真实、客观、仔细地评价(上限100字)</p><br />
                            	<textarea name="comment" id="comment" onblur="checklen()"></textarea>
                            </div>

                        </td>
                    </tr>
                	<tr>
                    	<td class="pl">快递公司：</td>
                        <td>
                       <!-- <div class="xing"><img src="/pic/xing_s.png" onclick="check_pl(2)" />
                        <img src="/pic/xing_s.png" onclick="check_pl(4)" />
                        <img src="/pic/xing_s.png" onclick="check_pl(6)" />
                        <img src="/pic/xing_s.png" onclick="check_pl(8)" />
                        <img src="/pic/xing_s.png" onclick="check_pl(10)" />
                        <input type="hidden" id="starvalue" name="starvalue" value="" />
                        </div><p class="xing_jg"><span>非常好！</span>物流公司服务好，速度很快！</p>-->
                        
                        <div class="user_rate">
                            <div class="big_rate_bak">
                                <b rate="2" onclick="javascript:up_rate(20);">&nbsp;</b>
                                <b rate="4" onclick="javascript:up_rate(40);">&nbsp;</b>
                                <b rate="6" onclick="javascript:up_rate(60);">&nbsp;</b>
                                <b rate="8" onclick="javascript:up_rate(80);">&nbsp;</b>
                                <b rate="10" onclick="javascript:up_rate(100);">&nbsp;</b>
                                <div style="width:45px;" class="big_rate_up"></div>
                            </div>
                            <p><span id="s" class="s"></span><span id="g" class="g"></span></p>
                        </div>
                        <div class="remark" id="remark"></div>
                        <input type="hidden" name="logistics" id="logistics" value="8" />
                        <input type="hidden" name="id" id="id" value="<?php echo $this->wayItem->id; ?>"/>
                        </td>
                    </tr>
                </table>
                <div class="tijiao">
                	<a class="pingbutton" href="#" ><span><input type="submit" value ="提交评论" ></input></span></a>
                </div>
            </div>
            </form>
            <div class="pingright">
            	<h2>关于服务评价：</h2>
                <ul>
                	<li>请您根据本次服务，给予真实、客观、仔细地评价；</li>
                    <li>您的评价将是其他会员的参考；</li>
                    <li>对您的评价我们讲给予您<span>100</span>积分奖励。</li>
                </ul>
                <p><a href="#">了解更多...</a></p>
            </div>
        </div>
        <?php if($this->wayItem!=null){?>
      <div class="yundan">
       	<h2>运单信息</h2>
          <table>
           	  <tr>
               	  <td class="kd">物品重量：</td>
               	  <td><?php echo $this->wayItem->weight.' 克';?></td>
               	  <td class="kd">包裹重量：</td>
               	  <td><?php echo $this->wayItem->bagWeight.' 克';?></td>
           	  </tr>
           	  <tr>
               	  <td class="kd">运单号码：</td>
               	  <td><?php echo $this->wayItem->billNo;?>	</td>
               	  <td class="kd">提交时间：</td>
               	  <td><?php echo $this->wayItem->dateCreated;?>	</td>
           	  </tr>
           	  <tr>
               	  <td class="kd">运送方式：</td>
               	  <td><?php echo $this->wayItem->shipType;?></td>
               	  <td class="kd">总 运 费：</td>
               	  <td><?php echo $this->wayItem->shipMoney;?>	</td>
           	  </tr>
           	  <tr>
               	  <td class="kd">收货地址：</td>
               	  <td colspan="3"><?php echo $this->wayItem->consignee.'，'.$this->wayItem->shipType.'，'.$this->wayItem->conAdd.'，'.$this->wayItem->conPostCode;?></td>
           	  </tr>
          </table>
        </div>
        <?php }?>
    </div>
</div>
<script type="text/javascript">
$(function(){
	get_rate(80);
})
function get_rate(rate){
	rate=rate.toString();
	var s;
	var g;
	$("#g").show();
	if (rate.length>=3){
		s=10;	
		g=0;
		$("#g").hide();
	}else if(rate=="0"){
		s=0;
		g=0;
	}else{
		s=rate.substr(0,1);
		g=rate.substr(1,1);
	}
	$("#logistics").val(s);
	$("#s").text(s);
	$("#g").text("."+ g);
	$(".big_rate_up").animate({width:(parseInt(s)+parseInt(g)/10) * 14,height:26},1000);
	$(".big_rate_bak b").each(function(){
		$(this).mouseover(function(){
			$(".big_rate_up").width($(this).attr("rate") * 14 );
			$("#s").text($(this).attr("rate"));
			$("#g").text("");
			setRemark($(this).attr("rate"));
		}).click(function(){
			$("#f").text($(this).attr("rate"));
			$("#my_rate").show();
		})
	})
	$(".big_rate_bak").mouseout(function(){
		$("#s").text(s);
		$("#g").text("."+ g);
		$(".big_rate_up").width((parseInt(s)+parseInt(g)/10) * 14);
		setRemark(s);
	})
}
function up_rate(rate){
	$(".big_rate_up").width(0);
	get_rate(rate);
}
function setRemark(value) {
	value = parseInt(value);
	switch (value) {
		case 2:
		    $("#remark").text('非常差');
			break;
		case 4:
		    $("#remark").text('不好');
			break;
		case 6:
		    $("#remark").text('一般');
			break;
		case 8:
		    $("#remark").text('良好');
			break;
		case 10:
		    $("#remark").text('优秀');
			break;
	
	}
}
</script>